#define _CRT_SECURE_NO_WARNINGS 1
int missingNumber(int* nums, int numsSize)
{
	int num = 0;
	int i = 0;
	for (i = 0; i<numsSize; i++)
	{
		num ^= nums[i];
	}
	for (int j = 0; j <= numsSize; j++)
	{
		num ^= j;
	}
	return num;
}
void reverse(int* nums, int left, int right)
{
	while (left<right)
	{
		int tmp = nums[left];
		nums[left] = nums[right];
		nums[right] = tmp;
		left++;
		right--;
	}
}

void rotate(int* nums, int numsSize, int k)
{
	k %= numsSize;
	reverse(nums, 0, numsSize - k - 1);
	reverse(nums, numsSize - k, numsSize - 1);
	reverse(nums, 0, numsSize - 1);
}